package com.exceptions;

/**
 * The Class PersistenceException.
 * 
 * Exception for persistence operations
 */
public class PersistenceException extends BaseException {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 48235356L;

	 /**
     * Empty constructor. Calls superclass constructor of same signature.
     */
    public PersistenceException() {
        super();
    }

    /**
     * Constructor with error message. Calls superclass constructor of same signature.
     *
     * @param message The error message
     */
    public PersistenceException(String message) {
        super(message);
    }

    /**
     * Constructor with the exception that was thrown. Calls superclass constructor of same signature.
     *
     * @param cause The exception that was thrown.
     */
    public PersistenceException(Throwable cause) {
        super(cause);
    }

    /**
     * Full constructor. Calls superclass constructor of same signature.
     *
     * @param message The error message
     * @param cause The exception that was thrown.
     */
    public PersistenceException(String message, Throwable cause) {
        super(message, cause);
    }
	

	@Override
	public String toString() {
		String error = this.getClass().getName() + "\nCaused by: "
		        + this.getMessage() + "\nLocalized Messaje: "+this.getLocalizedMessage()+"\n Please contact to the system administrator";
		return error;
	}

}
